<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title>部门详情添加</title>
</head>
<style type="text/css">
    i{cursor: pointer;}
   .pic{
        width:138px;
        height:118px;
        border-radius:0% ;
        cursor: pointer;
        background: #fff;
        /*position: absolute;
        */z-index: 1;
        }
</style>
<script src="http://www.jq22.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://www.jq22.com/jquery/bootstrap-3.3.4.js"></script>
<script src="__PUBLIC__/Admin/js/distpicker.data.js"></script>
<script src="__PUBLIC__/Admin/js/distpicker.js"></script>
<script src="__PUBLIC__/Admin/js/main.js"></script>
<script src="__PUBLIC__/Admin/js/imgUp.js"></script>
<script type="text/javascript">
    <volist name="info.product_line" id="product_line">
        $('#product_line{$product_line}').attr('checked', true);
    </volist>
</script>
<body>
<div class="contant">
    <div class="row">
        <div class="top">首页>部门详情添加</div>
        <div class="content addapply">
            <form class="form-horizontal" method="post" action='{:U("Group/edit_groupInfo")}' enctype="multipart/form-data" onsubmit="return form_validate()">
                <div class="box">
                    <h1>新增<span>(标*为必填项)</span></h1>
                    <div class="list-block">
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">渠道名称</label>
                            <div class="col-sm-10">
                                <input name="place_name" type="text" class="form-control" value="{$info.place_name}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">详细地址</label>
                            <div data-toggle="distpicker" id="now-address" class="col-sm-10">
                                <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="province" name="now_province"></select>
                                <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="city" name="now_city"></select>
                                <select style="margin-right: 15px;" class="myCss col-xs-10 col-sm-2" id="district" name="now_district"></select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">通讯地址</label>
                            <div class="col-sm-10">
                                <input name="communicate_address" type="text" class="form-control" value="{$info.communicate_address}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">通讯电话</label>
                            <input style="width: 25%;"  type="text" class="myCss col-xs-10 col-sm-2" name="tel" id='tel' value="{$info.communicate_tel}">
                            <label  class="col-sm-2 control-label" for="form-field-1">负责人姓名</label>
                            <input style="width: 25%;" type="text" class="myCss col-xs-10 col-sm-2" name="principal_name" value="{$info.principal_name}">
                        </div>
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">邮箱地址</label>
                            <div class="col-sm-10">
                                <input name="email" type="text" class="form-control" value="{$info.email}" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">企业账号</label>
                            <input style="width: 25%;"  type="text" class="myCss col-xs-10 col-sm-2" name="account_one" value="{$info.company_account}">
                            <label  class="col-sm-2 control-label" for="form-field-1">开户行</label>
                            <input style="width: 25%;" type="text" class="myCss col-xs-10 col-sm-2" name="bank_one" value="{$info.company_bank}">

                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">企业账号2</label>
                            <input style="width: 25%;"  type="text" class="myCss col-xs-10 col-sm-2" name="account_two" value="{$info.company_account2}">
                            <label  class="col-sm-2 control-label" for="form-field-1">开户行2</label>
                            <input style="width: 25%;" type="text" class="myCss col-xs-10 col-sm-2" name="bank_two" value="{$info.company_bank2}">

                        </div>
                        <div class="form-group">
                            <label for="department" class="col-sm-2 control-label">结算方式</label>
                            <div class="col-sm-10">
                                <label class="radio-inline">
                                    <input type="radio" name="settle_type" id="inlineRadio1" value="0" <eq name="info.settle_type" value="0">checked</eq>> 公账
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="settle_type" id="inlineRadio2" value="1" <eq name="info.settle_type" value="1">checked</eq>> 私账
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="department" class="col-sm-2 control-label">合作模式</label>
                            <div class="col-sm-10">
                                <label class="radio-inline">
                                    <input type="radio" name="model" id="inlineRadio1" value="1" <eq name="info.model" value="1">checked</eq>> 直营团队
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="model" id="inlineRadio2" value="2" <eq name="info.model" value="2">checked</eq>> 阶段性担保
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="model" id="inlineRadio3" value="3" <eq name="info.model" value="3">checked</eq>> 5050担保
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="model" id="inlineRadio4" value="4" <eq name="info.model" value="4">checked</eq>> 全程担保
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="model" id="inlineRadio5" value="5" <eq name="info.model" value="5">checked</eq>> 联创模式
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">单次结算比例</label>
                            <input style="width: 25%;"  type="number" class="myCss col-xs-10 col-sm-2" name="ratio" value="{$info.ratio}"><span style="margin-top: 1%;float: left;">%</span>
                            <label  class="col-sm-2 control-label" for="form-field-1">票据成本</label>
                            <input style="width: 25%;" type="number" class="myCss col-xs-10 col-sm-2" name="ticket_cost" value="{$info.ticket_cost}"><span style="margin-top: 1%;">%</span>

                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">终端上限</label>
                            <input style="width: 25%;"  type="number" class="myCss col-xs-10 col-sm-2" name="rate_max" value="{$info.rate_max}">
                            <label  class="col-sm-2 control-label" for="form-field-1">终端底限</label>
                            <input style="width: 25%;" type="number" class="myCss col-xs-10 col-sm-2" name="rate_min" value="{$info.rate_min}">

                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">结算费率</label>
                            <input style="width: 25%;"  type="number" class="myCss col-xs-10 col-sm-2" name="settle_rate" value="{$info.settle_rate}"><span style="margin-top: 1%;float: left;">%</span>
                            <label  class="col-sm-2 control-label" for="form-field-1">返佣上限</label>
                            <input style="width: 25%;" type="number" class="myCss col-xs-10 col-sm-2" name="rebate_max" value="{$info.rebate_max}">

                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">我方风险拨备比例</label>
                            <input style="width: 25%;"  type="number" class="myCss col-xs-10 col-sm-2" name="my_risk_ratio" value="{$info.my_risk_ratio}"><span style="margin-top: 1%;float: left;">%</span>
                            <label  class="col-sm-2 control-label" for="form-field-1">渠道风险拨备比例</label>
                            <input style="width: 25%;" type="number" class="myCss col-xs-10 col-sm-2" name="place_risk_ratio" value="{$info.place_risk_ratio}"><span style="margin-top: 1%;">%</span>

                        </div>
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">产品线</label>
                            <div class="col-sm-10">
                                <label class="radio-inline">
                                    <input type="checkbox" name="product_line[]" id='product_line1' value="1"> 新车
                                </label>
                                <label class="radio-inline">
                                    <input type="checkbox" name="product_line[]" id='product_line2' value="2"> 二手车
                                </label>
                                <label class="radio-inline">
                                    <input type="checkbox" name="product_line[]" id='product_line3' value="3"> 商用车
                                </label>
                                <label class="radio-inline">
                                    <input type="checkbox" name="product_line[]" id='product_line4' value="4"> 租赁车
                                </label>

                            </div>
                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">简易贷最高金额</label>
                            <input style="width: 25%;"  type="number" class="myCss col-xs-10 col-sm-2" name="easy_max" value="{$info.easy_credit_max}">
                            <label  class="col-sm-2 control-label" for="form-field-1">履约保证金</label>
                            <input style="width: 25%;" type="number" class="myCss col-xs-10 col-sm-2" name="performance_money" value="{$info.performance_money}">

                        </div>
                        <div class="form-group">
                            <label style="margin-right: 15px;" class="col-sm-2 control-label" for="form-field-1">杠杆比例</label>
                            <input style="width: 25%;"  type="number" class="myCss col-xs-10 col-sm-2" name="gearing" value="{$info.gearing_ratio}"><span style="margin-top: 1%;float: left;">%</span>
                            <label  class="col-sm-2 control-label" for="form-field-1">保证金上限</label>
                            <input style="width: 25%;" type="number" class="myCss col-xs-10 col-sm-2" name="deposit" value="{$info.deposit_max}">
                        </div>
                        <div class="form-group">
                            <label for="rate" class="col-sm-2 control-label">业务区域</label>
                            <div class="col-sm-10">
                                <input name="area" type="text" class="form-control" id="rate" name='business_area' value="{$info.business_area}">
                            </div>
                        </div>

                    </div>
                    <div class="list-block">
                        <div class="row">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for="">
                                <input class="upload" name="idcard_copy_img" accept="image/*" type="file" style="display: none"/><i>负责人身份证复印件</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>
                            <label class="inputfile" for="">
                                <input class="upload" name="business_license" accept="image/*" type="file" style="display: none"/><i>企业证照</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>
                            <label class="inputfile" for="">
                                <input class="upload" name="protocol_img1" accept="image/*" type="file" style="display: none"/><i>合作协议</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>
                            <label class="inputfile" for="">
                                <input class="upload" name="protocol_img2" accept="image/*" type="file" style="display: none"/><i>征信授权书</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>
                            <label class="inputfile" for="">
                                <input class="upload" name="protocol_img3" accept="image/*" type="file" style="display: none"/><i>协议1</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>
                            <label class="inputfile" for="">
                                <input class="upload" name="protocol_img4" accept="image/*" type="file" style="display: none"/><i>协议2</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>
                            <label class="inputfile" for="">
                                <input class="upload" name="protocol_img5" accept="image/*" type="file" style="display: none"/><i>协议3</i>
                                <img class="pic" src="__PUBLIC__/Common/images/default_upload.png" >
                            </label>


                        </div>
                    </div>
                    <div class="list-block">
                        <input type="submit" class="button01" value="提交">
                        <input type="hidden" name='id' value="{$info.id}" />
                        <input type="hidden" name="group_id" value="{$group_id}" />
                        <input type="button" class="button01 goHistory" value="返回">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.goHistory').click(function(){
        window.history.back(-1);
    });
// 初始化地区
    $("#now-address").distpicker({
      province: '{$now_areaInfo.province}',
      city: '{$now_areaInfo.city}',
      district: '{$now_areaInfo.district}'
    });

        $(function() {
        $("i").click(function (elm) {

        $(this).siblings('.upload').click();//隐藏了input:file样式后，点击头像就可以本地上传
        $(this).siblings('.upload').on("change",function(){
            var objUrl = getObjectURL(this.files[0]) ; //获取图片的路径，该路径不是图片在本地的路径
            if (objUrl) {
            $(this).siblings('.pic').attr("src", objUrl) ; //将图片路径存入src中，显示出图片
            }
            });
        });
    });
     
    //建立一個可存取到該file的url
    function getObjectURL(file) {
        var url = null ;
        if (window.createObjectURL!=undefined) { // basic
        url = window.createObjectURL(file) ;
        } else if (window.URL!=undefined) { // mozilla(firefox)
        url = window.URL.createObjectURL(file) ;
        } else if (window.webkitURL!=undefined) { // webkit or chrome
        url = window.webkitURL.createObjectURL(file) ;
        }
        return url ;
    }

   function form_validate(){
        var phone = document.getElementById('tel').value;
        if(!(/^1[34578]\d{9}$/.test(phone))){
            alert("手机号码有误,请重填");
            return false;
        }
         return true;
   }
</script>
</body>
</html>